import { http } from "@/utils/http";

export type ResultType = ReplaceTargetType<any[]>;

// 保存知识图谱数据
export const graphSaveApi = (params) => {
  return http.request<any>({
    url: "/kgManagerApi/knowledge/graph/save",
    method: "post",
    params: {},
    data: params,
  });
};

// 获取知识图谱数据
export const graphDetailApi = () => {
  return http.request<ResultType>({
    url: "/kgManagerApi/knowledge/graph/detail",
    method: "get",
    params: {},
    data: {},
  });
};

// 获取知识图谱数据
export const queryDictApi = (params) => {
  return http.request<ResultType>({
    url: "/cupSystemApi/dict/dictionary",
    method: "get",
    params: {
      code: params.code,
    },
    data: {},
  });
};

// 获取知识图谱数据
export const downloadDesignApi = () => {
  return http.request<ResultType>({
    url: "/kgManagerApi/knowledge/graph/downloadDesign",
    method: "get",
    responseType: "blob",
    params: {},
    data: {},
  });
};

// 删除校验
export const delVerifyApi = (params) => {
  return http.request<ResultType>({
    url: "/kgManagerApi/knowledge/graph/delVerify",
    method: "get",
    params: params,
    data: {},
  });
};
